#!/usr/bin/python

import BeachData
import Reports

class ForecastCollective:
	'An object that contains a list of beach objects, and therefore multi-beach related functionality'	
	def __init__(self):
		self.beachObjList = []	

	################################
	# make an array of beach objects by web scraping
	def makeBeachObjsFromWeb(self, beachNumberList):
		for beachNum in beachNumberList:
			self.beachObjList.append(BeachData.BeachData())
			self.beachObjList[-1].scrapeBeachInfo(beachNum)
		return 0
	
	################################
	# make an array of beach objects from a disk file
	def makeBeachObjsFromFile(self, beachNumberList):
		for beachNum in beachNumberList:
			self.beachObjList.append(BeachData.BeachData())
			self.beachObjList[-1].loadFromFile(beachNum)
		return 0
	
	################################
	# filter the beach object array of bad surf days on all beach objects	
	def filterAllBadDays(self):
		for beachObj in self.beachObjList:
			beachObj.filterBadDays()
		return 0
	
	################################
	# store all beach objects to disk file	
	def storeAllToFile(self):
		for beachObj in self.beachObjList:
			beachObj.storeToFile()
		return 0
